<%--
Created by IntelliJ IDEA.
User: jt
Date: 2021/1/26
Time: 10:20
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<!doctype html>
<html>
<head>
    <meta charset="UTF-8"/>
    <title>后台管理</title>
    <link rel="stylesheet" type="text/css" href="css/common.css"/>
    <link rel="stylesheet" type="text/css" href="css/main.css"/>
</head>
<body>
<script src="../js/jquery-1.9.1.js"></script>
<script>
    //读取cookie
    function getCookie(name)
    {
        var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)");
        if(arr=document.cookie.match(reg))
            return unescape(arr[2]);
        else
            return null;
    }
    //初始化
    function chushihua() {
        $.ajax({
            url:"http://localhost:8080/searchydzg",
            type:"get",
            data:{
                username:getCookie("user")
            },
            success:function (res) {
                data=res.data;
                console.log(data);
                var neirong="";
                var tian="";
                for(i=0;i<data.length;i++){
                    var zgname = data[i]["zgname"];
                    var zhuangtai=data[i]["zhuangtai"];
                    var username=data[i]["username"];
                    tian="<p>" +
                        "<td class=\"tc\"><input name=\"id[]\" value=\"59\" type=\"checkbox\"></td>\n" +
                        "<td>\n" +
                        "<input name=\"ids[]\" value=\"59\" type=\"hidden\">\n" +
                        "<input class=\"common-input sort-input\" name=\"ord[]\" value=\"0\" type=\"text\">\n" +
                        "</td>\n" +
                        "<td>1</td>\n" +
                        "<td>展馆名："+zgname+"</td>\n" +
                        "<td>展馆状态："+zhuangtai+"</td>\n" +
                        "<td>所属用户："+username+"</td>\n" +
                        "<td>\n" +
                        "<a class=\"link-del\" href=\"\/deluserzg?username="+username+"&zgname="+zgname+"\">删除</a>\n" +
                        "</td>\n" +
                        "</p>";
                    neirong=neirong+tian;
                }
                var nei=document.getElementsByClassName("zhanwei")[0];
                var nei1=document.createElement("zhanwei1");
                nei.appendChild(nei1)
                nei.innerHTML=neirong;
                // console.log(neirong)

            }

        })

    }
    if(getCookie("user")){
        //user有值完成初始化
        chushihua();
    }
</script>
<div class="topbar-wrap white">
    <div class="topbar-inner clearfix">
        <div class="topbar-logo-wrap clearfix">
            <h1 class="topbar-logo none"><a href="index.html" class="navbar-brand">后台管理</a></h1>
            <ul class="navbar-list clearfix">
                <li><a class="on" href="index.html">首页</a></li>
                <li><a href="#" target="_blank">网站首页</a></li>
            </ul>
        </div>
        <div class="top-info-wrap">
            <ul class="top-info-list clearfix">
                <li><a href="#">管理员</a></li>
                <li><a href="#">修改密码</a></li>
                <li><a href="#">退出</a></li>
            </ul>
        </div>
    </div>
</div>
<div class="container clearfix">
    <div class="sidebar-wrap">
        <div class="sidebar-title">
            <h1>菜单</h1>
        </div>
        <div class="sidebar-content">
            <ul class="sidebar-list">
                <li>
                    <a href="#"><i class="icon-font">&#xe003;</i>常用操作</a>
                    <ul class="sub-menu">
                        <li><a href="design.jsp"><i class="icon-font">&#xe001;</i>我的会馆</a></li>
                        <li><a href="insert.jsp"><i class="icon-font">&#xe001;</i>会展发布</a></li>
                    </ul>
                </li>
               
            </ul>
        </div>
    </div>
    <!--/sidebar-->
    <div class="main-wrap">

        <div class="crumb-wrap">
            <div class="crumb-list"><i class="icon-font"></i><a href="index.html">首页</a><span class="crumb-step">&gt;</span><span class="crumb-name">作品管理</span></div>
        </div>
        <div class="search-wrap">
            <div class="search-content">

            </div>
        </div>
        <div class="result-wrap">
            <form name="myform" id="myform" method="post">
                <div class="result-title">
                    <div class="result-list">
                        <a href="insert.html"><i class="icon-font"></i>新增作品</a>
                        <a id="batchDel" href="javascript:void(0)"><i class="icon-font"></i>批量删除</a>
                        <a id="updateOrd" href="javascript:void(0)"><i class="icon-font"></i>更新排序</a>
                    </div>
                </div>
                <div class="result-content">

                        <div class="zhanwei">
                            <table class="result-tab" width="100%">
                                <tr>
                                    <th class="tc" width="5%"><input class="allChoose" name="" type="checkbox"></th>
                                    <th>排序</th>
                                    <th>ID</th>
                                    <th>标题</th>
                                    <th>审核状态</th>
                                    <th>请求人</th>
                                    <th>操作</th>
                                </tr>

                            </table>
                        </div>

<%--                    <div class="list-page"> 2 条 1/1 页</div>--%>
                </div>
            </form>
        </div>
    </div>
    <!--/main-->
</div>
</body>
</html>